#include"com.h"

int main()
{
  int fd = open(File_Name, O_WRONLY);
  if(fd < 0)
  {
    perror("open failed!!!\n");
    return 1;
  }
  char msg[128];
  while(1)
  {
    msg[0] = '\0';
    printf("Please Enter# ");
    fflush(stdout);
    ssize_t s = read(0, msg, sizeof(msg)-1);
    if(s>0)
    {
      msg[s-1] ='\0';
      //将信息写入命名管道
      write(fd,msg,strlen(msg));
    }
  }
  close(fd);

  return 0;
}
